package com.scheduler.backend.po;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor

@Entity
@Table(name = "craft")
@IdClass(Craft.CraftPK.class)
public class Craft {

    @Id
    //@Column(name = "product_id")
    private String productId;

    @Id
    //@Column(name = "artifact_name")
    private String artifactName;

    @Column(name = "craft_order")
    private Integer craftOrder;

    @Column(name = "deleted")
    private Integer deleted = 0;

    @lombok.Data
    @lombok.Builder
    @lombok.AllArgsConstructor
    @lombok.NoArgsConstructor
    public static class CraftPK implements Serializable {

        private static final long serialVersionUID = 20201112;

        @Column(name = "product_id")
        private String productId;

        @Column(name = "artifact_name")
        private String artifactName;

    }

}
